Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed a few 2D bugs #85

Merged
merged 2 commits into from
Oct 31, 2024
Merged

fixed a few 2D bugs #85

merged 2 commits into from
Oct 31, 2024

Conversation

hsalehipour
Copy link
Collaborator

@hsalehipour hsalehipour commented Oct 25, 2024

Contributing Guidelines

Description

  • Pytest was failing on a 2D cases of test_bc_indices_masker_warp.py. This PR fixes that.
  • Also fixed a couple simialr bugs in 2D regularied_bc and kbc (Warp) that emerged after merging 2d and 3d kernels

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • All pytest tests pass

Linting and Code Formatting

Make sure the code follows the project's linting and formatting standards. This project uses Ruff for linting.

To run Ruff, execute the following command from the root of the repository:

ruff check .
  • Ruff passes

@hsalehipour hsalehipour changed the title fixed a pytest bug fixed a few 2D bugs Oct 25, 2024
@mehdiataei
Copy link
Contributor

I'll wait for you to push other changes. One comment for now is to squash your commits with a better description on your end.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 25, 2024
@hsalehipour hsalehipour reopened this Oct 25, 2024
examples/cfd/lid_driven_cavity_2d.py Show resolved Hide resolved
return -_u_vec(_c_float[0, l], _c_float[1, l], _c_float[2, l])
if wp.static(_d == 3):
for l in range(_q):
if missing_mask[l] == wp.uint8(1) and wp.abs(_c[0, l]) + wp.abs(_c[1, l]) + wp.abs(_c[2, l]) == 1:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not make sense. As we only have 3D vectors in Warp.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not true. The lattice velocity "c" is still represents a 2D vector per each lattice dimenion for a 2D lattice and a 3D vector per each lattice dimension for a 3D lattice.

else:
for l in range(_q):
if missing_mask[l] == wp.uint8(1) and wp.abs(_c[0, l]) + wp.abs(_c[1, l]) == 1:
return -_u_vec(_c_float[0, l], _c_float[1, l])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not working with 2D vectors anymore in the Warp backend and their use should be avoided. The vectors shouldn't depend on the grid dimension. I guess this is being done because this is a normal. But the fix should be done more fundamentally to avoid downstream issues.

For example in 2D, you may have only (1,0,0) and (0,1,0),...Why would this not be working? I think the change should be down in the code that utilizes this normals later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the above comment.

@mehdiataei mehdiataei merged commit 8eb7024 into Autodesk:main Oct 31, 2024
10 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants